package model.commands.commandable;

import java.util.List;
import model.Environment;
import model.SyntaxErrorException;
import model.commands.Command;


/**
 * Name:
 * LEFT degrees
 * LT degrees
 * 
 * Description:
 * turns turtle counterclockwise by degrees angle
 * returns the value of degrees
 * 
 * @author JLongley
 * @author Erick Gonzalez
 */
public class LeftCommand extends Command {

    @Override
    public int evaluate(Environment e) throws SyntaxErrorException {
        List<Command> myArguments = getArguments();
        int turnAmount = myArguments.get(0).evaluate(e);
        e.invokeCommandableMethod(Environment.ROTATE, -turnAmount);
        return turnAmount;
    }

}
